def _build_full_context(self, current_prompt: str, history: List[Dict] = None) -> str:
    """构建包含所有对话历史的完整上下文"""
    context_parts = []
    
    # 添加系统提示
    system_prompt = "你是一个严谨的传记事实核查助手。请根据用户的要求进行多轮事实核查。"
    context_parts.append(f"<|system|>\n{system_prompt}</s>")
    
    # 添加历史对话
    if history:
        for entry in history:
            context_parts.append(f"<|user|>\n{entry['prompt']}</s>")
            context_parts.append(f"<|assistant|>\n{entry['response']}</s>")
    
    # 添加当前提示
    context_parts.append(f"<|user|>\n{current_prompt}</s>")
    context_parts.append("<|assistant|>")
    
    return "\n".join(context_parts)

def save_conversation(self, filename="conversation_history.json"):
    """保存完整对话历史"""
    import json
    # if llama2
    if MODEL_NAME == "meta-llama/Llama-2-7b-chat-hf": # "meta-llama/Llama-2-7b-chat-hf"
        filename="conversation_history_llama2.json"

    # if llama3
    if MODEL_NAME == "meta-llama/Llama-3.1-8B": # "meta-llama/Llama-2-7b-chat-hf"
        filename="conversation_history_llama3.json"
    with open(filename, "w", encoding="utf-8") as f:
        json.dump(self.conversation_history, f, ensure_ascii=False, indent=2)
    print(f"对话历史已保存至 {filename}")
